# _*_ coding: utf-8 _*_
import time
import Page
from Page import BaseInfo
from Operate.BaseOperate import BaseOperate
from selenium.webdriver.common.by import By


class BasicInformationPage(BaseOperate):
    """
    基础信息页
    """

    def __init__(self, driver):
        BaseOperate.__init__(self, driver)

        # 基本信息标题
        self.base_info_text = (By.XPATH, "//*[@id=’app‘]/section/section/section/main/div[1]/h2")

        # 数据概览标题
        self.data_overview_text = (By.XPATH, "//*[@id=’scroll‘]/div[1]/div/div[1]/div[2]/span[1]")

        # 数据概览tab
        self.data_overview_tab_btn = (By.XPATH, "//*[@id=’app‘]/section/section/aside/div/ul/li[2]/a/span")

    def get_base_info(self):
        """
        获取基础信息页面标题
        """
        return self.find_element_0(self.base_info_text)

    def get_data_overview(self):
        """
        获取数据概览标题
        """
        return self.find_element_0(self.data_overview_text)

    def click_data_overview_tab(self):
        """
        点击数据概览tab
        """
        self.click_element(self.data_overview_tab_btn)

    def is_display_account_select(self):
        """
        是否进入基础信息页面
        :return:
        """
        return self.is_display(self.base_info_text)



